<template>
	<div>
		<el-button @click="change">显示/隐藏</el-button>
		<div v-if="show" class="box"></div>
	</div>
</template>
<!-- https://xiaoman.blog.csdn.net/article/details/123000653 小满csdn，没测试过 -->
<script setup lang="ts">
import { ref } from 'vue';

const show = ref<boolean>(true);
const change = () => {
	show.value = !show.value;
};
</script>

<style lang="scss" scoped>
.box {
	width: 300px;
	height: 300px;
	background: red;
}
</style>
